package com.frxuexi.mine

import com.frxuexi.lib_base.ApiResp
import com.frxuexi.mine.entity.LeaveEntity
import kotlinx.coroutines.flow.Flow
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query

interface ApiService {

    @POST("/api/user/login")
    fun login(@Body body: RequestBody):Flow<ApiResp<String>>

    @POST("/api/leave/save")
    fun askLeave(@Body body: RequestBody):Flow<ApiResp<Any>>

    @GET("/api/leave/all")
    fun getLeaves(@Query("status") status:String):Flow<ApiResp<List<LeaveEntity>>>

    @POST("/api/leave/audit")
    fun approveLeave(@Body body: RequestBody):Flow<ApiResp<Any>>

}